home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-04 | 2.9 KB | 171 lines | [TEXT/CWIE] |
- // MADE - Macintosh Application Development Essentials
- // ---------------------------------------------------
-
- // (c) Gideon Greenspan, Sig Software - June 1997 - http://www.kagi.com/gdg/
-
- // These files can only be used for experimental standalone purposes. To obtain
- // fully commented code, and licenses for standalone, shareware, internal and
- // commercial usage, run the enclosed Register application.
-
- // User Functions.c
- //
- // Off the shelf responses, which should be replaced with your code, and moved to other files.
- //
- // Version 1.0.0 - 10th November 1996
-
- #include "Essential Headers.h"
- #include "Essential Prototypes.h"
-
- enum {
- FileStart=129*65536,
- FileNew,
- FileOpen,
- FileSep1,
- FileClose,
- FileSave,
- FileSaveAs,
- FileSep2,
- FilePageSetup,
- FilePrint,
- FileSep3,
- FileQuit,
-
- EditStart=130*65536,
- EditUndo,
- EditSep1,
- EditCut,
- EditCopy,
- EditPaste,
- EditClear
-
- };
-
- void MyInitialiseApplication()
- {
- }
-
- void MyClearUpApplication()
- {
- }
-
- #if Use_AppleEvents
-
- #if Handle_Open_Documents_Event
-
- void MyOpenDocument(FSSpec* fileSpec)
- {
- }
-
- #endif
-
- #if Handle_Print_Documents_Event
-
- void MyPrintDocument(FSSpec* fileSpec)
- {
- }
-
- #endif
-
- #endif
-
- #if Use_Drag_Manager
-
- RgnHandle MyGetDragRegion(WindowPtr inWindow, Point localPoint, DragReference dragRef)
- {
- return 0;
- }
-
- void MyReceiveDrag(WindowPtr inWindow, Point localPoint, DragReference dragRef)
- {
- }
-
- #endif
-
- void MySetTheCursor(Point localPoint)
- {
- ShowResCursor(plusCursor);
- }
-
- void MyPerformIdleTasks()
- {
- }
-
- void MyFreeUpMemory(Size spaceNeeded)
- {
- }
-
- void MyEnableMenus()
- {
- EnableMenuItem(129, 4, frontWindow!=0);
- }
-
- void MyPerformMenu(long selection)
- {
- Rect windowRect;
-
- switch (selection) {
- case FileNew:
- SetRect(&windowRect, 48, 48, 256, 256);
- NewWindow(0, &windowRect, "\p", true, documentProc, (WindowPtr)-1, true, 0);
- break;
-
- case FileClose:
- MyCloseWindow();
- frontWindow=0;
- // It is essential that this is done whenever the front window is closed,
- // otherwise it will seem to the rest of MADE that the window is still open
- break;
-
- case FileQuit:
- applicationHasQuit=true;
- break;
- }
- }
-
- void MyDrawWindow(WindowPtr drawWindow)
- {
- if (((WindowPeek)drawWindow)->hilited) PaintRgn(drawWindow->visRgn);
- else InvertRgn(drawWindow->visRgn);
- }
-
- void MyHandleKeyDown(char keyCharacter, short modifiers)
- {
- }
-
- void MyHandleMouseDown(Point localPoint, short modifiers)
- {
- Rect eraseOval;
-
- do {
- SetRect(&eraseOval, localPoint.h-2, localPoint.v-2, localPoint.h+2, localPoint.v+2);
- EraseOval(&eraseOval);
-
- GetMouse(&localPoint);
- } while (StillDown());
- }
-
- void MyCloseWindow()
- {
- DisposeWindow(frontWindow);
- }
-
- void MyActivateWindow()
- {
- InvalRgn(frontWindow->visRgn);
- }
-
- void MyDeactivateWindow()
- {
- InvalRgn(frontWindow->visRgn);
- }
-
- void MyResizeBounds(Rect* growLimits)
- {
- SetRect(growLimits, 128, 64, qd.screenBits.bounds.right,
- qd.screenBits.bounds.bottom);
- }
-
- void MySizedWindow()
- {
- }
-